package com.mol.market.common.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;

/**
 * Author: Andrew.Wang
 * Date  : 13-1-7
 */
public class ListViewImpl extends ListView {

    private OnScrollChangedListener mListener;

    public ListViewImpl(Context context) {
        super(context);
    }

    public ListViewImpl(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public ListViewImpl(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public void setScrollChangeListener(OnScrollChangedListener listener) {
         mListener = listener;
    }

    @Override
    protected void onScrollChanged(int l, int t, int oldl, int oldt) {
        super.onScrollChanged(l, t, oldl, oldt);

        if (mListener != null) {
            mListener.onScrollChanged(getScrollX(), getScrollY());
        }
    }
}
